import request from '@/utils/request'

export const dstoolGetDynamicParamAll = (markId) => {
  return request.get('dictionary/dstool/dstoolGetDynamicParamAll', {
    params: {
      markId: markId
    }
  })
}

export const dstoolAddDynamicParamSpecs = (markId, name) => {
  return request.post('dictionary/dstool/dstoolAddDynamicParamSpecs?markId=' + markId + '&name=' + name)
}

// export const dstoolAddDynamicParamSpecsValue = (markId, specsValue) => {
//   return request.post('dictionary/dstool/dstoolAddDynamicParamSpecsValue?markId=' + markId + '&specsValue=' + { specsValue })
// }

export const dstoolAddDynamicParamSpecsValue = (specsValue) => {
  return request.post('dictionary/dstool/dstoolAddDynamicParamSpecsValue', specsValue)
}

export const editSkusIsuseData = (markId, id) => {
  return request.post('dictionary/dstool/editSkusIsuse?id=' + id + '&markId=' + markId)
}

export const getSkusByIdData = (markId, id) => {
  return request.get('dictionary/dstool/getSkusById', {
    params: {
      markId: markId,
      id: id
    }
  })
}

export const updateSkusData = (skus) => {
  return request.post('dictionary/dstool/updateSkus', {
    id: skus.id,
    oldPrice: skus.oldPrice,
    price: skus.price,
    inventory: skus.inventory,
    markId: skus.markId,
    picture: skus.picture
  })
}

export const dstoolDelDynamicParamSpecs = (markId, id) => {
  return request.post('dictionary/dstool/dstoolDelDynamicParamSpecs?markId=' + markId + '&id=' + id)
}
